package pl.edu.mimuw.irs.core.morph.maxmatch;


/**
 * @author Jakub Rauch
 * Created on: 2009-05-07
 */
public class HopcroftKarp {
	/*
	// *** Methods
	public Set<Map<Resource, Role>> getResult(Set<Resource> actors, Set<Role> roles) {
		// TODO
		return null;
	}
	
	public void findAugmentingPath(BipartiteGraph graph, Match match) {
		//Set<Vertex> freeVertexes1 = graph.getPartition1();
		//Set<Vertex> freeVertexes2 = graph.getPartition2();
		BipartiteDirectedGraph directedGraph = createDirectedGraph(graph, match);
		directedGraph.getEdges();
	}
	
	private BipartiteDirectedGraph createDirectedGraph(BipartiteGraph graph, Match match) {
		Set<Vertex> vertexes1 = graph.getPartition1();
		Set<Vertex> vertexes2 = graph.getPartition2();
		Set<DirectedEdge> directedEdges = new HashSet<DirectedEdge>();
		for (Edge edge : graph.getEdges()) {
			Vertex sourceVertex = edge.getContainedVertex(vertexes1);
			Vertex targetVertex = edge.getContainedVertex(vertexes2);
			directedEdges.add(new DirectedEdge(sourceVertex, targetVertex));
		}
		for (Edge edge : match.getEdges()) {
			Vertex sourceVertex = edge.getContainedVertex(vertexes2);
			Vertex targetVertex = edge.getContainedVertex(vertexes1);
			directedEdges.add(new DirectedEdge(sourceVertex, targetVertex));
		}
		return new BipartiteDirectedGraph(vertexes1, vertexes2, directedEdges);
	}*/
}
